package com.yc.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户测评记录实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("userTestRecords")
public class UserTestRecord {
    
    @TableId(value = "recordId", type = IdType.AUTO)
    private Long recordId;
    
    @TableField("userId")
    private Long userId;
    
    @TableField("testId")
    private Long testId;
    
    @TableField("status")
    private String status; // new, in_progress, completed, abandoned
    
    @TableField("startTime")
    private LocalDateTime startTime;
    
    @TableField("submitTime")
    private LocalDateTime submitTime;
    
    @TableField("durationSeconds")
    private Integer durationSeconds;
    
    @TableField("currentQuestionIndex")
    private Integer currentQuestionIndex;
    
    @TableField("totalScore")
    private BigDecimal totalScore;
    
    @TableField("standardScore")
    private BigDecimal standardScore;
    
    @TableField("scoreLevel")
    private String scoreLevel;
    
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    // 非数据库字段：关联信息
    @TableField(exist = false)
    private String testTitle;
    
    @TableField(exist = false)
    private String testIcon;
    
    @TableField(exist = false)
    private Integer progress; // 测评进度百分比
    
    @TableField(exist = false)
    private List<UserTestAnswer> answers;
} 